#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<string>
using namespace std;
class Solution {
public:
    string reverseStr(string s, int k) {
        size_t n = s.size();
        for (size_t i = 0; i < n; i += 2 * k)
        {
            reverse(s.begin() + i, s.begin() + min(i + k, n));
        }
        return s;
    }
};
int main()
{
    Solution s;
    string S1("abcdefg");
    S1 = s.reverseStr(S1, 2);
    cout << S1 << endl;
    return 0;
}